//
//  RPAccountView.m
//  RPCFCADemo_Example
//
//  Created by 宋鸿康 on 2022/10/19.
//  Copyright © 2022 john. All rights reserved.
//

#import "RPAccountView.h"

@interface RPAccountView()
@property(nonatomic, strong) UILabel *accountLabel;
@property(nonatomic, strong) UIView *lineView;
@end

@implementation RPAccountView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initUI];
    }
    return self;
}

- (void)initUI
{
    [self addSubview:self.accountLabel];
    [self addSubview:self.accountField];
    [self addSubview:self.lineView];
    
    
    [self.accountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.left.mas_equalTo(24);
    }];
    [self.accountField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.accountLabel.mas_bottom).offset(0);
        make.left.right.inset(24);
    }];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(0);
        make.left.right.inset(24);
        make.height.mas_equalTo(0.5);
    }];
}

- (UILabel *)accountLabel
{
    if (!_accountLabel) {
        _accountLabel = [[UILabel alloc] init];
        _accountLabel.text = @"账号";
        _accountLabel.font = [CFTool font:15];
        _accountLabel.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _accountLabel.textAlignment = NSTextAlignmentCenter;
        [_accountLabel sizeToFit];
    }
    return _accountLabel;
}

- (UITextField *)accountField
{
    if (!_accountField) {
        _accountField = [[UITextField alloc] init];
        _accountField.textColor = [UIColor colorWithHexString:@"#EEEEEE"];
        _accountField.font = [CFTool font:15];
        _accountField.tintColor = [UIColor colorWithHexString:@"EEEEEE"];
    }
    return _accountField;
}

- (UIView *)lineView
{
    if (!_lineView) {
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = [UIColor whiteColor];
    }
    return _lineView;
}
@end
